#ifndef CUBE_MESH_HPP
#define CUBE_MESH_HPP

#include <QOpenGLFunctions_3_3_Core>
#include <QVector3D>
#include <QVector2D>

class CubeMesh : protected QOpenGLFunctions_3_3_Core {
public:
    CubeMesh();
    ~CubeMesh();

    void init();       // 创建缓冲
    void draw();       // 绘制立方体
    void destroy();    // 清除资源

private:
    struct Vertex {
        QVector3D position;
        QVector3D normal;
        QVector2D texCoord;
    };

    GLuint _vao = 0;
    GLuint _vbo = 0;
    GLuint _ebo = 0;
};

#endif // CUBE_MESH_HPP

